<template>
    <div>
        <Modal :title="modalTitle" v-model="modalShow" :width="modalWidth" :mask-closable="false" :closable="false">
            <br>
            <h3 style="text-align: center">{{modalContent}}</h3>
            <div slot="footer">
                <Button type="text" @click="cancelOption">取消</Button>
                <Button type="success" @click="submitOption" :loading="btnLoading">确认</Button>
            </div>
        </Modal>
    </div>
</template>

<script>

export default {
  name: 'confirmModal',
  props: {
    modalTitle: {
      type: String,
      default: () => {
        return '提示'
      }
    },
    modalShow: {
      type: Boolean,
      default: () => {
        return false
      }
    },
    modalWidth: {
      type: Number,
      default: () => {
        return 500
      }
    },
    modalContent: {
      type: String,
      default: () => {
        return '确认开始数据导入？'
      }
    }
  },
  data () {
    return {
      btnLoading: false,
      formItem: {}
    }
  },
  methods: {
    cancelOption () {
      this.$emit('cancelOption')
    },
    submitOption () {
      this.$emit('submitOption')
    },
    success (val) {
      val = this.$common.xeUtils.isEmpty(val) ? '操作成功' : val
      this.$Message.success(val)
    },
    error (data) {
      this.$Message.error({
        content: '操作失败,\n' + data.errmsg
      })
    }
  },
  mounted () {
  },
  computed: {}
}
</script>

<style scoped>
</style>
